package stolbik;

public class slojenie {
	
	public static int[] arr1;
	public static int[] arr2;
	public static int[] arr3;
	public static int length=5;
	public static int n=0;
	
	public static void create()
	{

	for(int i=1;i<length;i++)
	{
		arr1[i]=(int) (Math.random() * 9);
	}
	for(int i=0;i<length-1;i++)
	{
		arr2[i]=(int) (Math.random() * 9);
	}
	}
		public static void	print()
		    {
			for(int i=0;i<length;i++){
				System.out.print(arr1[i]);
			}
			System.out.println();
			for(int i=0;i<length;i++)
			{
				System.out.print(arr2[i]);
			}
			System.out.println();
			for(int i=0;i<length;i++)
			{
				System.out.print(arr3[i]);
			}
		}
		public static void sloj()
		{
			for(int i=length-1;i>=0;i--)
			{
				arr3[i]=arr1[i]+arr2[i]+n;
				n=0;
				if(arr3[i]>=10)
				{
					arr3[i]=arr3[i]%10;
					n=1;
				}
				}
			}
	public static void main(String[] args) 
	{
		 arr1 = new int[length];
		 arr2 = new int[length];
		 arr3 = new int[length];
		create();
		sloj();
		print();
	
	}
}
